<%@ page contentType="text/html; charset=iso-8859-1" language="java" %>
<%@ page import="com.metier.IUtilisateurBasique" %>
<%@ page import="com.metier.IEtude" %>
<%@ page import="com.metier.IOutils" %>
<head>
<script type="text/javascript" src="/Contacto/pages/js/formation.js">	
</script>
</head>
<%

	String s="";
	
	 String id =request.getParameter("id");
	 String idEtude =request.getParameter("idEtude");
	 System.out.println("idEtude: "+idEtude);
	 System.out.println("id: "+id);
	 
	 IOutils outils = (IOutils) request.getSession().getServletContext().getAttribute("Outils");
	 
	 IUtilisateurBasique utilisateur = (IUtilisateurBasique)request.getSession().getAttribute("Utilisateur");
	 IEtude etude= utilisateur.getEtude(Integer.valueOf(idEtude));
	 boolean isSituationActuelle = utilisateur.isSituationActuelle();
	 int anneeDebut=etude.getDebut().intValue();
	 int anneeFin =0; 
	 
	 String checked = "";
	 String disable = "";
	 if(etude.isActuel()){
	 		checked="checked='yes'";
	 		disable="disabled='true'";
	 	}
	 else
	 {
		 anneeFin=etude.getFin().intValue();
	 }
	 String nom = etude.getEcole().getNom();
	 String ville = etude.getEcole().getVille();
	 String pays = etude.getEcole().getPays();
	 String specialite = etude.getSpecialite();
	 
	 String listAnneesDebut ="";
	 listAnneesDebut = outils.getListAnneesString(anneeDebut);
	 String listAnneesFin="";
	 listAnneesFin = outils.getListAnneesString(anneeFin);
	 
 
 	 s="<div id='popUpProfil' class='popUp'>"
			+"<div id='popUpDescriptionProfil'>"
			+"<div id='titre'>"
				+"Modifier Formation"
			+"</div>"
			+"<div id='croix'></div>"
			+"<div class='annuleFloat'></div>"
			+"<div id='erreurs' class='erreurs' style='display: none'></div>"
			+"<div id='contenu'>"
				
				+"<form action='FormationProfil.do' method='post' name='formulaire' onSubmit='return verif()' >"
				+"<input type='hidden' name='action' value='formModifieFormationProfil'/>"
				+"<input type='hidden' name='idEtude' value='"+idEtude+"'/>"
		 		+"<input type='hidden' name='idEcole' id='idEcole' value=''/>"
		
					+"<table>"
						+"<tr>"
							+"<th align='right'>"
									+"<label id='dateDeDebutLbl'>"
									+"<strong>Date de debut* : </strong>"
								+"<label>"
							+"</th>"
							+"<td>"
								+"<select name='anneeDeDebut'  size='1'>"
									+listAnneesDebut+"</select>"
							+"</td>"
						+"</tr>"
						
						+"<tr>"
							+"<th align='right'>"
								
							+"</th>"
							+"<td>"
								+"<strong>Actuel:</strong><input type='checkbox' "+ checked +"  name='actuel' onclick='isActuel();'/>"
								+"<input type='hidden' name='verifActuel' value='"+isSituationActuelle +"'/>"
							+"</td>"
						+"</tr>"
						
						+"<tr>"
							+"<th align='right'>"
									+"<label id='dateDeFin2Lbl'>"
									+"<strong>Date de fin* : </strong>"
								+"<label>"
							+"</th>"
							+"<td>"
								
								+"<select name='anneeDeFin2' "+ disable+ "  size='1'>"
										+listAnneesFin+"</select>"
							+"</td>"
						+"</tr>"
						
						+"<tr>"
							+"<th align='right'>"
									+"<label id='etablissementLbl'>"
									+"<strong>Etablissement* : </strong>"
								+"<label>"
							+"</th>"
							+"<td>"
								+"<input type='text' id='etablissement' name='etablissement' value='"+nom+"' size='30'	maxlength='50' autocomplete='off' onkeyup='return autoCompletionEcole()' />"
							+"</td>"
						+"</tr>"
						
						+"<tr>"
							+"<th align='right'>"
									+"<label id='specialiteLbl'>"
									+"<strong>Specialite* : </strong>"
								+"<label>"
							+"</th>"
							+"<td>"
								+"<input type='text' name='specialite'  size='30' value='"+specialite+"'	maxlength='50' />"
							+"</td>"
						+"</tr>"
						
						+"<tr>"
							+"<th align='right'>"
									+"<label id='villeLbl'>"
									+"<strong>Ville* : </strong>"
								+"<label>"
							+"</th>"
							+"<td>"
								+"<input type='text' id='ville' name='ville' size='30' value='"+ville+"'	maxlength='50' />"
							+"</td>"
						+"</tr>"
						
						+"<tr>"
						+"<th align='right'>"
								+"<label id='paysLbl'>"
								+"<strong>Pays* : </strong>"
							+"<label>"
						+"</th>"
						+"<td>"
							+"<input type='text' id='pays' name='pays' size='30' value='"+pays+"'	maxlength='50' />"
						+"</td>"
					 +"</tr>"
						
					+"</table>"
			
				
				+"<div class='annuleFloat'></div>"
					+"<div id='boutons'>"
							+"<input type='submit' id='valider' value='' name='valider'/>"
							+"</form>"
							+"<form action='profil.do' method='post' name='annulerProfil' onSubmit='true'>"
							+"<input type='submit' id='annuler' value='' name='annulerProfil'/>"
							+"<input type='hidden' name='action' value='annulerProfil'/>"
							+ "</form>"
					+ "</div>"				
			+"</div>"
		+"</div>"
	+"</div>";
	
	out.print(s);
 %>
 